import java.awt.event.*;
import javax.swing.*;

public class Action implements ActionListener {
	JTextField text;
	Action(JTextField text){
		this.text=text;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		String str=e.getActionCommand();
		String textstr=text.getText();
		if(textstr.contains("=")) {
			textstr="";
		}
		
		String newStr=textstr+str;
		text.setText(newStr);
		
	}

}
